<?php
require_once("ISearchBoat.php");
class BoatInfoAlternative implements ISearchBoat {
	public function Search (array $boats, $keyword){
			$pattern = "/".$keyword."/i";
			$i = 0;
			
			foreach ($boats as $key =>$value){
				if(preg_match($pattern, $value->m_boatInfo) > 0){
					$result[$i] = $value;
					$i++; 
				}
			}
			if(!empty($result)){
				var_dump($result);
			}else{
				echo"inga sökresultat";
			}
	}
}